using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class patient_diaryMap : EntityTypeConfiguration<patient_diary>
    {
        public patient_diaryMap()
        {
            // Primary Key
            this.HasKey(t => t.diary_id);

            // Properties
            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.update_by)
                .HasMaxLength(20);

            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.drug_name_1)
                .HasMaxLength(50);

            this.Property(t => t.drug_name_2)
                .HasMaxLength(50);

            this.Property(t => t.drug_name_3)
                .HasMaxLength(50);

            this.Property(t => t.drug_name_4)
                .HasMaxLength(50);

            this.Property(t => t.drug_name_5)
                .HasMaxLength(50);

            this.Property(t => t.drug_usage_1)
                .HasMaxLength(50);

            this.Property(t => t.drug_usage_2)
                .HasMaxLength(50);

            this.Property(t => t.drug_usage_3)
                .HasMaxLength(50);

            this.Property(t => t.drug_usage_4)
                .HasMaxLength(50);

            this.Property(t => t.drug_usage_5)
                .HasMaxLength(50);

            this.Property(t => t.drug_dosage_1)
                .HasMaxLength(50);

            this.Property(t => t.drug_dosage_2)
                .HasMaxLength(50);

            this.Property(t => t.drug_dosage_3)
                .HasMaxLength(50);

            this.Property(t => t.drug_dosage_4)
                .HasMaxLength(50);

            this.Property(t => t.drug_dosage_5)
                .HasMaxLength(50);

            this.Property(t => t.fruit_name)
                .HasMaxLength(50);

            this.Property(t => t.weather)
                .HasMaxLength(50);

            this.Property(t => t.other_hospital)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.other_ills)
                .IsFixedLength()
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("patient_diary");
            this.Property(t => t.diary_id).HasColumnName("diary_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.update_time).HasColumnName("update_time");
            this.Property(t => t.update_by).HasColumnName("update_by");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.diary_date).HasColumnName("diary_date");
            this.Property(t => t.sbp_1).HasColumnName("sbp_1");
            this.Property(t => t.dbp_1).HasColumnName("dbp_1");
            this.Property(t => t.weight).HasColumnName("weight");
            this.Property(t => t.smoke_status).HasColumnName("smoke_status");
            this.Property(t => t.smoke_number).HasColumnName("smoke_number");
            this.Property(t => t.is_salt_limit).HasColumnName("is_salt_limit");
            this.Property(t => t.is_oil_limit).HasColumnName("is_oil_limit");
            this.Property(t => t.sbp_2).HasColumnName("sbp_2");
            this.Property(t => t.dbp_2).HasColumnName("dbp_2");
            this.Property(t => t.sbp_3).HasColumnName("sbp_3");
            this.Property(t => t.dbp_3).HasColumnName("dbp_3");
            this.Property(t => t.salt_qty).HasColumnName("salt_qty");
            this.Property(t => t.oil_qty).HasColumnName("oil_qty");
            this.Property(t => t.fruit_qty).HasColumnName("fruit_qty");
            this.Property(t => t.vegetable_qty).HasColumnName("vegetable_qty");
            this.Property(t => t.sport_1_minutes).HasColumnName("sport_1_minutes");
            this.Property(t => t.sport_2_minutes).HasColumnName("sport_2_minutes");
            this.Property(t => t.total_energe).HasColumnName("total_energe");
            this.Property(t => t.sport_3_minutes).HasColumnName("sport_3_minutes");
            this.Property(t => t.sport_4_minutes).HasColumnName("sport_4_minutes");
            this.Property(t => t.belly_perimeter).HasColumnName("belly_perimeter");
            this.Property(t => t.drug_name_1).HasColumnName("drug_name_1");
            this.Property(t => t.drug_name_2).HasColumnName("drug_name_2");
            this.Property(t => t.drug_name_3).HasColumnName("drug_name_3");
            this.Property(t => t.drug_name_4).HasColumnName("drug_name_4");
            this.Property(t => t.drug_name_5).HasColumnName("drug_name_5");
            this.Property(t => t.drug_usage_1).HasColumnName("drug_usage_1");
            this.Property(t => t.drug_usage_2).HasColumnName("drug_usage_2");
            this.Property(t => t.drug_usage_3).HasColumnName("drug_usage_3");
            this.Property(t => t.drug_usage_4).HasColumnName("drug_usage_4");
            this.Property(t => t.drug_usage_5).HasColumnName("drug_usage_5");
            this.Property(t => t.drug_dosage_1).HasColumnName("drug_dosage_1");
            this.Property(t => t.drug_dosage_2).HasColumnName("drug_dosage_2");
            this.Property(t => t.drug_dosage_3).HasColumnName("drug_dosage_3");
            this.Property(t => t.drug_dosage_4).HasColumnName("drug_dosage_4");
            this.Property(t => t.drug_dosage_5).HasColumnName("drug_dosage_5");
            this.Property(t => t.fruit_name).HasColumnName("fruit_name");
            this.Property(t => t.weather).HasColumnName("weather");
            this.Property(t => t.followup_target).HasColumnName("followup_target");
            this.Property(t => t.comm_hospital).HasColumnName("comm_hospital");
            this.Property(t => t.other_hospital).HasColumnName("other_hospital");
            this.Property(t => t.hbp_followup).HasColumnName("hbp_followup");
            this.Property(t => t.other_ills).HasColumnName("other_ills");
            this.Property(t => t.all_cost).HasColumnName("all_cost");
            this.Property(t => t.medicine_cost).HasColumnName("medicine_cost");
            this.Property(t => t.personal_cost).HasColumnName("personal_cost");
            this.Property(t => t.feel_record).HasColumnName("feel_record");
        }
    }
}
